package com.riq;

import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;

import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;

public class MockServletConfig implements ServletConfig {
  private Map<String, String> initParameters = new HashMap<String, String>();
  private ServletContext servletContext;

  public String getServletName() {
    throw new UnsupportedOperationException();
  }

  public ServletContext getServletContext() {
    return servletContext;
  }

  public String getInitParameter(String string) {
    return initParameters.get(string);
  }

  public Enumeration getInitParameterNames() {
    return null;
  }

  // Mock methods

  public void setInitParameter(String key, String value) {
    this.initParameters.put(key, value);
  }

  public void setServletContext(ServletContext servletContext) {
    this.servletContext = servletContext;
  }
}